package com.example.netty

import java.util.UUID

/**
 * File Name :People
 * Author : qihualu
 * Date : 2024/4/18
 * Desc :
 **/

data class People (
    val name:String,
    val gender:String,
    val age:Int
){
    private val id :Long = UUID.randomUUID().leastSignificantBits

    override fun equals(other: Any?): Boolean {
        if (this === other) return true
        if (javaClass != other?.javaClass) return false

        other as People

        if (name != other.name) return false
        if (gender != other.gender) return false
        if (age != other.age) return false
        if (id != other.id) return false

        return true
    }

    override fun hashCode(): Int {
        var result = name.hashCode()
        result = 31 * result + gender.hashCode()
        result = 31 * result + age
        result = 31 * result + id.hashCode()
        return result
    }
}


data class School(
    val students:List<People>
)